package com.owen.mybatis.dynamic.datasource.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.owen.mybatis.dynamic.datasource.entity.SetTest;
import com.owen.mybatis.dynamic.datasource.mapper.SetTestMapper;
import com.owen.mybatis.dynamic.datasource.service.SetTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SetTestServiceImpl implements SetTestService {

    @Autowired
    private SetTestMapper setTestMapper;

    @DS("master")
    @Override
    public List<SetTest> getSetTest1() {
        return setTestMapper.selectList(null);
    }

    @DS("slave_1")
    @Override
    public List<SetTest> getSetTest2() {
        return setTestMapper.selectList(null);
    }
}
